package com.sz.biz.common.base.dto;

import java.io.Serializable;

/**
 * Package: com.sz.biz.common.base.dto <br>
 * Function: TODO: ADD FUNCTION <br>
 * Author: Charles. <br>
 * Date: 2017-04-12 16:38:00.
 */
public class CountryModel implements Serializable {

    private String code;
    private String name;

    public CountryModel(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 此方法仅为保持与前端的兼容性，请勿调用本方法
     *
     * @return
     */
    @Deprecated
    public String getFigureCode() {
        return this.getCode();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        CountryModel that = (CountryModel) o;

        if (code != null ? !code.equals(that.code) : that.code != null) {
            return false;
        }
        return name != null ? name.equals(that.name) : that.name == null;
    }

    @Override
    public int hashCode() {
        int result = code != null ? code.hashCode() : 0;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        return result;
    }
}
